<?php
$link =  mysqli_connect("localhost","root","root","students");
$username = $_POST['username'];
$gender = $_POST['gender'];
$age = $_POST['age'];

$sql1 = "INSERT INTO `tables` (username,gender,age) VALUES ('$username','$gender',$age)";
mysqli_query($link,$sql1);

$sql="SELECT * FROM tables where is_delete=1";
$res=mysqli_query($link,$sql);
$arrALL=[];
while($arr=mysqli_fetch_assoc($res)){
$arrALL[]=$arr;
};
echo json_encode($arrALL);
?>